package com.study.springbootsecurity.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@TableName("sys_menu")
@Schema(name = "SysMenu", description = "系统菜单实体")
public class SysMenu implements Serializable {

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Schema(description = "菜单ID", example = "1")
    private Long id;

    @Schema(description = "父级菜单ID", example = "0")
    private Integer parentId;

    @Schema(description = "菜单编号", example = "sys:user:view")
    private String code;

    @Schema(description = "菜单名称", example = "用户管理")
    private String name;

    @Schema(description = "菜单别名", example = "user")
    private String alias;

    @Schema(description = "请求资源路径", example = "/system/user")
    private String path;

    @Schema(description = "请求方式", example = "GET")
    private String method;

    @Schema(description = "菜单资源", example = "user")
    private String source;

    @Schema(description = "排序方式", example = "1")
    private Integer sort;

    @Schema(description = "菜单分类;0：菜单 ；1：按钮", example = "0")
    private Integer category;

    @Schema(description = "菜单状态；1-正常；0：禁用", example = "1")
    private Integer status;

    @Schema(description = "权限标识", example = "sys:user:view")
    private String perms;

    @Schema(description = "按钮动作", example = "1")
    private Integer menuAction;

    @Schema(description = "是否打开新页面", example = "0")
    private Integer isOpen;

    @Schema(description = "菜单描述", example = "用户管理页面")
    private String remark;

    @TableLogic(delval = "1",value = "0")
    @Schema(description = "是否删除;0：未删除；1：已删除", example = "0")
    private Integer isDelete;

    @Schema(description = "创建时间", example = "2023-01-01 10:00:00")
    private LocalDateTime createTime;

    @Schema(description = "更新时间", example = "2023-01-01 10:00:00")
    private LocalDateTime updateTime;
}
